package Design_patterns.creator_mode.factory.factory_method;


/**
 * @description: 咖啡店
 **/

public class CoffeeStore {
    private CoffeeFactory coffeeFactory;

    public void setCoffeeFactory(CoffeeFactory coffeeFactory) {
        this.coffeeFactory = coffeeFactory;
    }

    //点咖啡功能
    public Coffee orderCoffee() {
        Coffee coffee = coffeeFactory.createCoffee();
        coffee.addMilk();
        coffee.addSugar();
        System.out.println("coffee.getName() = " + coffee.getName());
        return coffee;
    }
}
